<%@ page language="java" import="java.util.*,java.net.URLDecoder" pageEncoding="UTF-8"%>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	String cname = String.valueOf(request.getAttribute("cname"));
    String ctype = (String)request.getAttribute("ctype");
    Integer cid = Integer.parseInt(request.getParameter("cid"));
    String stype="yes";
    if (ctype.indexOf("n")>0){stype="no";}
     %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
      <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>粮油集团办公自动化协作平台</title>
	<link href="<%=basePath %>articles/style/css.css" rel="stylesheet" type="text/css" />
	<link href="articles/style/houtaianniu.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script> 
	<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=basePath%>articles/manage/js/manageSave.js"></script>

	<script type="text/javascript" src="<%=basePath%>ajaxFramework/jQuery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>js/My97DatePicker/WdatePicker.js" defer="defer"></script>
 
    <script type="text/javascript" src="<%=basePath%>ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="<%=basePath%>ckfinder/ckfinder.js"></script>
   
  </head>
  <body>
     <div id="component" style="width:100%;height:1300px;">
    <div id="toolmenu"></div>
    <script type="text/javascript">
        parent.iFrameHeight();
     	var cid = '<%out.print(cid); %>';
 		var basePath = '<%out.print(basePath); %>';
 		var _ctype='<%out.print(ctype); %>';
 		var name='<%out.print(cname);%>';
 		var _cname=decodeURI(name);
 		var viewtype = '';
		 Ext.onReady(function(){
		  	 var Toolbar = new Ext.Toolbar({
			        	height:28,
		                renderTo : "toolmenu"
		           });
		  	 Toolbar.add([{
		                text : "保存",
		                 iconCls: 'save',
		                handler : function(){
		                		document.getElementById('component').style.height = "600px";	
			        			parent.iFrameHeight();
				        		formSubmit();
				        		
		                }
		            }, {
		                text : "返回",
		                iconCls: 'back',
		                handler : function(){
				        		window.location.href = basePath +'articles/manage/manageList.jsp?cid=<%out.print(cid); %>&type=<%out.print(stype); %>';	}
		            }]);
		     Toolbar.addFill();
		     Toolbar.addText('<a style="font-weight:bold; color:black;line-height: 22px;">'+ _cname + '</a>&nbsp;&nbsp;&nbsp;'); 
		     
		}); 
  	</script>
 
    <div id="xt" style="overflow-y:visible">
        <form action="tjsinfo/tjsoa/articles/Manage.do?method=addArticles" method="post" name="form1">
          <input type="hidden" name="cid" id="cid" value = "<%=cid %>"/>
          <input id="basePath" value="<%=basePath%>" type="hidden"/>
          <div style="height: 100%; clear: both;margin-top: 20px">
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
                <td>  
                   <div class="tab_file10">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td colspan="2"><div>
                        <table width="100%"><tr>
	                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;标题:&nbsp;</td>
	                        <td align="left" width="500">
	                        <textarea name="_title" id="_title" rows="2" cols="60"></textarea>
	                        <font color="#FF0000">(必填)</font></td>
                        <td valign="top" align="center" width="150">显示顺序:</td>
                        <td align="left" >
                          <input name="_showOrder" id="_showOrder" type="text" size="10" class="textinput" onkeypress="number()" onkeyup="filterInput()" onchange="filterInput()" onbeforepaste="filterPaste()" onpaste="return false"/>
                          <input type="checkbox" id="checkboxtop" name="checkboxtop" value ="置顶" onclick="totop()"/><font color="#FF0000">置顶</font>
                        </td>
                        </tr></table>
                        </div></td>
                        </tr>
                      <tr>
                      <td colspan="2"><div id="id_shortTitle" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;短标题:&nbsp;</td>
                        <td align="left"><input name="_shortTitle" id="_shortTitle" type="text" size="110" class="textinput"/></td>
                      </tr></table>
                      </div></td>
                      </tr>
                        <tr>
                      <td colspan="2"><div id="id_author" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;作者:&nbsp;</td>
                        <td align="left"><input name="_author" id="_author" type="text" size="110" class="textinput"/></td>
                      </tr></table>
                      </div></td>
                      </tr>
                      <tr>
                      <td colspan="2"><div id="id_keywords" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;关键字:&nbsp;</td>
                        <td align="left"><input name="_keywords" id="_keywords" type="text" size="110" class="textinput"/></td>
                       </tr></table>
                      </div></td>
                      </tr>
                   
                      <tr>
                      <td colspan="2"><div id="id_smallContent" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;摘要:&nbsp;</td>
                        <td align="left"><textarea name="_smallContent" id="_smallContent" rows="2" cols="110"></textarea></td>
                      </tr></table>
                      </div></td>
                      </tr>
                                     
                      <tr><td colspan="2"><div id="id_availableDate" style='display: none;'>
                        <table width="100%"><tr>
	                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;有效时间:&nbsp;</td>
	                        <td align="left">
	                        <input name="_availableDate" type="text" size="58%" class="textinput" readonly="readonly" id="_availableDate" class="Wdate" onclick="WdatePicker({el:'_availableDate',dateFmt:'yyyy-MM-dd'})"/><font color="#FF0000">(必填)</font></td>
                        </tr></table>
                      </div></td></tr>
                       <tr>
                      <td colspan="2"><div id="id_url" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;超链接:&nbsp;</td>
                        <td align="left"><input name="_url" id="_url" type="text" size="68%" class="textinput"/></td>
                      </tr></table>
                      </div></td>
                      </tr>
                       <tr>
                      <td colspan="2"><div id="id_showMode"  style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">显示模式:&nbsp;</td>
                        <td align="left">
                            <input type="radio" name="viewype" id="viewtype0" value="0" checked/>
			        		<input type="radio" name="viewype" id="viewtype1" value="1"/>
			        		<input type="radio" name="viewype" id="viewtype2" value="2"/>
			        		<input type="radio" name="viewype" id="viewtype3" value="3"/>
			                <input type="radio" name="viewype" id="viewtype4" value="4"/>
			                <input type="hidden" name="_isfile" id="_isfile" value="0"/>
                        </td>
                        </tr></table>
                      </div></td>
                      </tr>
                      <tr>
                      <td colspan="2"><div id="id_smallPicUrl" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;小图片:&nbsp;</td>
                        <td valign="top" colspan="2">
                          <textarea name="_smallPicUrl" id="_smallPicUrl" cols="70%" rows="2" class="ckeditor" ></textarea>
                          <script type="text/javascript">
							var editor=
					  		CKEDITOR.replace( '_smallPicUrl',
						     {
					  			width:'580',
							    height : '410',
							    align: 'center',
							    toolbar : 'MyToolbar3',
							    filebrowserBrowseUrl        : '<%=basePath %>ckfinder/ckfinder.html',
					  	        filebrowserImageBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Images',
					  	        filebrowserFlashBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Flash',
					  	        filebrowserUploadUrl        : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
					  	        filebrowserImageUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
					  	        filebrowserFlashUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
						     });
						     CKFinder.SetupCKEditor(editor);
						  </script>
                        </td>
                      </tr></table>
                      </div></td>
                      </tr>
                   
                      
                       <tr>
                      <td colspan="2"><div id="id_uploadFile" style='display: none;'>
                        <table width="100%"><tr>
                        <td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;上传附件:&nbsp;
						 <div id="id_isFile" style='display: none;'><font color="#FF0000">(必填)</font></div></td>
                         <td valign="top" colspan="2">
                          <textarea name="_uploadFile" id="_uploadFile" cols="70%" rows="2" class="ckeditor"></textarea>
                          <script type="text/javascript">
							var editor=
					  		CKEDITOR.replace( '_uploadFile',
						     {
					  			width:'600',
							    height : '80',
							    toolbar : 'MyToolbar5',
							    filebrowserBrowseUrl        : '<%=basePath %>ckfinder/ckfinder.html',
					  	        filebrowserImageBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Images',
					  	        filebrowserFlashBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Flash',
					  	        filebrowserUploadUrl        : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
					  	        filebrowserImageUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
					  	        filebrowserFlashUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
						     });
						     CKFinder.SetupCKEditor(editor);
						  </script>
                        </td>
                        </tr></table>
                      </div></td>
                      </tr>
                      <tr>
                      <td colspan="2"><div id="idcontent" style='display: none;'>
                        <table width="100%">
                        <tr><td width="20%" valign="top" align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;正文:</td>
                        <td valign="top" colspan="2">
                        <textarea name="content" id="content" cols="75%" rows="2" class="ckeditor"></textarea>
                          <script type="text/javascript">
						    var _height= Ext.get("component").getHeight()-700;
							var editor=
					  		CKEDITOR.replace( 'content',
						     {
					  			width:'800',
							    height : _height, 
					  			filebrowserBrowseUrl        : '<%=basePath %>ckfinder/ckfinder.html',
					  	        filebrowserImageBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Images',
					  	        filebrowserFlashBrowseUrl   : '<%=basePath %>ckfinder/ckfinder.html?Type=Flash',
					  	        filebrowserUploadUrl        : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
					  	        filebrowserImageUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
					  	        filebrowserFlashUploadUrl   : '<%=basePath %>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
						     });
							 CKFinder.SetupCKEditor(editor);
                          </script>
                        </td></tr>
                       </table>
                      </div></td>
                      </tr>
                    </table>
                  </div>
                </td>
              </tr>
            </table>
          </div>
        </form>

    </div>
    </div>
    <script type="text/javascript">
        var _cid = document.getElementById('cid').value;
//		document.getElementById('xt').style.height = Ext.get("component").getHeight()-28+"px";
	  window.onload = function () {
        setTimeout("initpage()", "800");//0.8秒后执行
      }
    </script>
  </body>
</html>
